[id].vue 698 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <LayoutContainer>
  3. <div>
  4. <h2>{{ $t('cycle') }}</h2>
  5. <UiFormEdition
  6. :model="Cycle"
  7. go-back-route="/parameters/teaching"
  8. >
  9. <template v-slot="{ entity }">
  10. <UiInputText
  11. field="label"
  12. v-model="entity.label"
  13. :rules="rules()"
  14. />
  15. </template>
  16. </UiFormEdition>
  17. </div>
  18. </LayoutContainer>
  19. </template>
  20. <script setup lang="ts">
  21. import { useI18n } from 'vue-i18n'
  22. import Cycle from "~/models/Education/Cycle";
  23. const i18n = useI18n()
  24. const rules = () => [
  25. (label: string | null) => (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
  26. ]
  27. </script>